﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys5a02
    {
		private string _listid;
		private string _plistid;
		private string _action;
		private string _pkfield;
		private string _ptable;
		private string _pfield;
		private string _pwhere;
		private string _porder;
		private string _remark;
		
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 页面控件标识
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 编辑模式
        /// </summary>
		public string Action
		{
			get { return _action;	 }
			set { _action=value;	}
		}
        /// <summary>
        /// 主键
        /// </summary>
		public string Pkfield
		{
			get { return _pkfield;	 }
			set { _pkfield=value;	}
		}
        /// <summary>
        /// 表
        /// </summary>
		public string Ptable
		{
			get { return _ptable;	 }
			set { _ptable=value;	}
		}
        /// <summary>
        /// 字段
        /// </summary>
		public string Pfield
		{
			get { return _pfield;	 }
			set { _pfield=value;	}
		}
        /// <summary>
        /// 条件
        /// </summary>
		public string Pwhere
		{
			get { return _pwhere;	 }
			set { _pwhere=value;	}
		}
        /// <summary>
        /// 排序
        /// </summary>
		public string Porder
		{
			get { return _porder;	 }
			set { _porder=value;	}
		}
        /// <summary>
        /// 备注
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
		
		public static List<Sys5a02> GetSys5a02ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys5a02> list = new List<Sys5a02>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys5a02 model = GetSys5a02ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys5a02 GetSys5a02ByDataRow(DataRow dr)
		{
			Sys5a02 model = new Sys5a02(); //实例化Sys5a02
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("action")&&!(dr["action"] is System.DBNull))  
				model.Action = ( string)dr["action"];
			if (dcc.Contains("pkfield")&&!(dr["pkfield"] is System.DBNull))  
				model.Pkfield = ( string)dr["pkfield"];
			if (dcc.Contains("ptable")&&!(dr["ptable"] is System.DBNull))  
				model.Ptable = ( string)dr["ptable"];
			if (dcc.Contains("pfield")&&!(dr["pfield"] is System.DBNull))  
				model.Pfield = ( string)dr["pfield"];
			if (dcc.Contains("pwhere")&&!(dr["pwhere"] is System.DBNull))  
				model.Pwhere = ( string)dr["pwhere"];
			if (dcc.Contains("porder")&&!(dr["porder"] is System.DBNull))  
				model.Porder = ( string)dr["porder"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			
			return model;
		}
    }
}
